package com.unknowpupil.eth.config;

import com.unknowpupil.eth.properties.EthProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.http.HttpService;

/**
 * @Classname: Web3jConfig
 * @Author: <a> w10g </a>
 * @CreateDate: Create in 2020/1/3 17:13
 * @Description:
 * @Version: 1.0
 */
@Component
public class Web3jConfig {
    @Autowired
    private EthProperties ethProperties;
    @Bean
    public Web3j web3j() {
        return Web3j.build(new HttpService(ethProperties.getUrl()));
    }
}
